#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QMenuBar *menubar = new QMenuBar(this);
    this->setMenuBar(menubar);

    QMenu *menu1 = new QMenu("文件 (&F)");
    QMenu *menu2 = new QMenu("编辑 (&E)");
    QMenu *menu3 = new QMenu("视图 (&V)");
    menubar->addMenu(menu1);
    menubar->addMenu(menu2);
    menubar->addMenu(menu3);

    QAction *action1 = new QAction("打开项目");
    QAction *action2 = new QAction("关闭项目");
    QAction *action3 = new QAction("删除项目");
    menu1->addAction(action1);
    menu1->addAction(action2);
    menu1->addAction(action3);
}

MainWindow::~MainWindow()
{
    delete ui;
}
